<template>
	<view>
		<view class="" style="font-size: 32rpx;border-top: 1rpx solid #e1e1e1;margin-top:6rpx;">
			<view
				style="padding-left: 15rpx;background-color: #FEF4E5;padding: 10rpx 10rpx 10rpx 15rpx;align-items: center;width: 100%;box-sizing: border-box;justify-content: space-between;"
				class="flex">
				<view class="flex" style="flex: 1;">
					<view class="text-center icon-tag" style="border: 1rpx solid #FF0000;color: #FF0000;">
						退款
					</view>
					<view class="" style="font-weight: bold;margin-left: 10rpx;">
						共{{ a.afsOrderGoodsNum }}件商品 金额 <text
							style="color: #E96636">{{ formatPrice(a.refundAmount) }}</text>
					</view>
				</view>
				<view class="flex align-center just-right" style="color:#4C4C4C;font-size: 32rpx;"
					@click.stop="setAfsOrderGoodsOpen1">
					<view>退款详情</view>
					<eui-uicons :type="afsOrderGoodsOpen1 ? 'up' : 'down'" size="15"
						style="color: #4C4C4C !important;margin-top: 6rpx;"></eui-uicons>
				</view>
			</view>
			<view style="line-height: 40rpx;font-size: 28rpx;margin-left: 8rpx;margin-top: 4rpx;">发起时间：{{ a.sponsorTime }}</view>
			<view class="" v-if="a.afsReason || a.afsDesc" style="line-height: 40rpx;font-size: 28rpx;margin-left: 8rpx;">
				原因：<text style="color: #FF3939">{{ a.afsDesc ? a.afsDesc : a.afsReason }}</text>
			</view>
		</view>
		<view v-if="afsOrderGoodsOpen1">
			<goods-list :goods-list="a.bcmAfsOrderGoodsList" type="afs" :showImage="showImage"></goods-list>
			<afs-order-state :scope="a" :a="a"></afs-order-state>
		</view>
	</view>
</template>

<script>
import GoodsList from '../../components/GoodsList.vue';
import AfsOrderState from './AfsOrderState.vue';
import { formatPrice } from '../../../../hooks/bcmUseUntils';

export default {
	props: {
		scope: {
			type: Object,
			default: {}
		},
		a: {
			type: Object,
			default: {}
		}
	},
	components: {
		GoodsList,
		AfsOrderState
	},
	data() {
		return {
			afsOrderGoodsOpen1: false,
			showImage: false
		}
	},
	methods: {
		setAfsOrderGoodsOpen1() {
			this.afsOrderGoodsOpen1 = !this.afsOrderGoodsOpen1
		},
		formatPrice
	}
};
</script>
<style lang="scss" scoped>
@import "@/static/font/enjoyicon/iconfont.css";
@import "../../common/common.css";
</style>